ssh -X root@10.8.1.200
nohup /usr/dt/bin/dtterm -name `hostname` -display 10.8.1.213:0.0 &
su - oracle
nohup /usr/dt/bin/dtterm -name oracle@`hostname` -display 10.8.1.213:0.0 &

#
# Open a new terminal
#
export CDS_BASE=/cds/workspace
export CDS_HOME=$CDS_BASE/trunk
export CDS_TOOLS=$CDS_BASE/dependencies
export PATH=$CDS_HOME/bin:$CDS_HOME/modules/internal/perftest/src/scripts/cdsadmin/:$CDS_HOME/tools:$PATH

# Java Application Server Installation
/sol9/sjsas_pe-9_0_01-p01-solaris-sparc.bin

# setting environment variables
cp /sol9/init_env.sh $CDS_HOME/bin/init_env.sh
cp /sol9/env.sh $CDS_HOME/modules/internal/perftest/src/scripts/cdsa_wrapper_scripts/env.sh

# buildall
cd $CDS_TOOLS
cdst buildall

# build perftest
cd $CDS_HOME/modules/
cdst build internal/perftest

####################################################
cd $CDS_HOME/modules/internal/perftest/src/scripts/cdsadmin
chmod +X cdsa
./cdsa pack

####################################################
bash-3.00# mkdir /sol9/workspace/release/
bash-3.00# cp /sol9/Sun_Java_System_Content_Delivery_Server_5.1_ga.zip /sol9/workspace/release/

cd $CDS_HOME/modules/internal/perftest/src/scripts/cdsa_wrapper_scripts/
./preparel.sh

# copy jdbc driver to the right dir
# cp ${CDS_HOME}/dist/cds/lib/external/ojdbc14.jar $CDS_HOME/dist/cds/lib/
# --------------------------------------------------------------------------------------------------------------------------------------------
# following ojdbc.jar file doesn't working fine with the CDS admin module. It will raise JDBC error in AppServer log and
# killed the AppServer instance.
# cp ${CDS_HOME}/dist/cds/lib/external/ojdbc14.jar $CDS_HOME/deployment/Sun_Java_System_Content_Delivery_Server_5.1_ga/dist/cds/lib
# cp ${CDS_HOME}/dist/cds/lib/external/ojdbc14.jar $CDS_HOME/deployment/Sun_Java_System_Content_Delivery_Server_5.1_ga/dist/cds/lib/external
# --------------------------------------------------------------------------------------------------------------------------------------------

diff /sol11/u01/app/oracle/product/11.1.0/db_1/sqldeveloper/jdbc/lib/ojdbc14.jar ${CDS_HOME}/dist/cds/lib/external/ojdbc14.jar
bash-3.00# ls -l /sol11/u01/app/oracle/product/11.1.0/db_1/sqldeveloper/jdbc/lib/ojdbc14.jar ${CDS_HOME}/dist/cds/lib/external/ojdbc14.jar
-rw-r--r--   1 oracle   oinstall 1545954 Dec  5  2006 /sol11/u01/app/oracle/product/11.1.0/db_1/sqldeveloper/jdbc/lib/ojdbc14.jar
-rw-r--r--   1 root     root     1200046 Sep 11 20:41 /sol9/workspace/trunk/dist/cds/lib/external/ojdbc14.jar

cp /sol11/u01/app/oracle/product/11.1.0/db_1/sqldeveloper/jdbc/lib/ojdbc14.jar $CDS_HOME/deployment/Sun_Java_System_Content_Delivery_Server_5.1_ga/dist/cds/lib
cp /sol11/u01/app/oracle/product/11.1.0/db_1/sqldeveloper/jdbc/lib/ojdbc14.jar $CDS_HOME/deployment/Sun_Java_System_Content_Delivery_Server_5.1_ga/dist/cds/lib/external

# startup SQE sample data on 10.8.100.51
ssh root@10.8.100.51
cd /export/home/work/tomcat-6.0.18/bin
./startup.sh
firefox http://localhost/sqe

# check /etc/hosts on the main server
bash-3.00# grep csgweb.sfbay.sun.com /etc/hosts
10.8.100.51     csgweb.sfbay.sun.com

firefox http://csgweb.sfbay.sun.com/sqe/

./setupl.sh

# ./setup.sh > /tmp/cds-setup.log
# tail -f /tmp/cds-setup.log

---------------------------------------------------------------------------------------------
--
--  step by step of setup.sh
--
---------------------------------------------------------------------------------------------
# for setupl.sh
cd $CDS_HOME/modules/internal/perftest/src/scripts/cdsa_wrapper_scripts/
. ./env.sh
CDS_HOME="$CDS_HOME_PARENT/$BINARY"
CDS_HOME="`eval \"echo $CDS_HOME\"`"
export CDS_HOME
export PATH=${CDS_HOME}/modules/internal/perftest/src/scripts/cdsadmin:${CDS_HOME}/tools:${CDS_HOME}/bin:.:/usr/bin:$PATH

PATH=${CDS_HOME}/modules/internal/perftest/src/scripts/cdsadmin:${CDS_HOME}/tools:${CDS_HOME}/bin:$PATH
. $CDS_HOME/cfg/cdsadmin.cfg

cdsa deploy delete

cdsa config dist
cdsa deploy deploy
cdsa config dep

if [ "$CDS_HOME_EXISTS" = "no" ]; then
   echo "starting config test *******************************"
   cdsa config test
fi

cdsa database delete
cdsa database init

cdsa runtime startserver
sleep 160

cdsa database handsetgen
sleep 60
cdsa database contentgen
sleep 60

cdsa database waitjobs
cdsa database cleanjobs
sleep 120

cdsa runtime stopserver
sleep 120

cdsa config select $DEPLOYMENT_NAME

cdsa database dropi
cdsa database dropc
sleep 120
cdsa database multiply $MULTIPLIER
sleep 120


#
# reference the setup.sh
#

#
# Oracle Startup
#
sqlplus / as sysdba <<EOF
startup
EOF

cd $ORACLE_HOME
bin/lsnrctl start

---------------------------------------------------------------------------------------------

cd $CDS_HOME/modules/internal/perftest/src/scripts/cdsadmin


# @changing to oracle server
#
# su - oracle

cp -r $CDS_HOME/modules/internal/perftest/src/scripts/cdsadmin .
mkdir $HOME/cds-scripts
cp $CDS_HOME/modules/internal/perftest/src/scripts/cdsadmin/jzou* $HOME/cds-scripts
cd $HOME/cds-scripts

sqlplus / as sysdba <<EOF
grant connect , resource to jzou_ps_owner identified by q1w2e3;
grant connect , resource to jzou_vs_owner identified by q1w2e3;
exit
EOF

sqlplus jzou_vs_owner/q1w2e3 > /tmp/tabs <<EOF
select * from tabs;
exit
EOF

sqlplus jzou_vs_owner/q1w2e3 <<EOF
select count(*) from RESOURCE_INSTANCE_FIELD;
select count(*) from RESOURCE_CLASS_FIELD;
exit
EOF

sqlplus jzou_vs_owner/q1w2e3 <<EOF
@jzou_vs.sql
EOF

# failed on running jzou_vs.sql. remove created tables
sqlplus jzou_vs_owner/q1w2e3 <<EOF
drop table log_category_item;
drop table log_category_item_map;
drop table log_ven_pricing_model_map;
drop table log_handset_content_map;
drop table log_instance_capability_map;
drop table log_large_capability_map;
drop table log_resource_content_data;
drop table CATEGORY_ITEM_TMP;
EOF

insert /*+ append */ into CATEGORY_ITEM_TMP nologging
    select
        CATEGORY_ITEM_ID + ' || (seq * TABLE_COUNT) || ',
        CATEGORY_ITEM_STATUS_ID,
        CONTENT_SIZE_BYTES,
        ITEM_NAME,
        DESCRIPTION,
        SHORT_DESCRIPTION,
        VERSION,
        CONTENT_TYPE_ID,
        DEVICE_ICON,
        SMALL_ICON,
        LARGE_ICON,
        SCREENSHOT_1,
        SCREENSHOT_2,
        USER_GUIDE,
        PREVIEW,
        PREVIEW_MIME_TYPE_ID,
        KEYWORD,
        CONTENT_PROVIDER_ID,
        DEVELOPER_CONTENT_ID,
        LOCATION_TYPE,
        AUTH_TYPE,
        AUTH_NAME,
        LOCATION_URL,
        AUTH_PASSWORD,
        CONTENT_CLASS_ID + ' || (seq * RC_COUNT) || ',
        CONTENT_INSTANCE_ID + ' || (seq * RI_COUNT) || ',
        TYPE,
        DEFAULT_PREVIEW_COLLECTION_ID,
        EDITION_PREVIEW_COLLECTION_ID,
        LAST_MODIFIED_DATE,
        CREATE_DATE,
        MOD_DATE,
        LOCK_VERSION
        from CATEGORY_ITEM';

sqlplus jzou_ps_owner/q1w2e3 <<EOF
@jzou_vs.sql
EOF


# setup hang at import handsets

/sol9/workspace/jdk1.5.0_11/bin/java -classpath /sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/xml-apis.jar:/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/xercesImpl.jar:/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/ant.jar:/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/ant-weblogic.jar:/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/ant-trax.jar:/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/ant-testutil.jar:/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/ant-swing.jar:/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/ant-stylebook.jar:/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/ant-starteam.jar:/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/ant-nodeps.jar:/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/ant-netrexx.jar:/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/ant-launcher.jar:/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/ant-junit.jar:/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/ant-jsch.jar:/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/ant-jmf.jar:/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/ant-jdepend.jar:/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/ant-javamail.jar:/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/ant-jai.jar:/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/ant-commons-net.jar:/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/ant-commons-logging.jar:/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/ant-apache-resolver.jar:/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/ant-apache-regexp.jar:/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/ant-apache-oro.jar:/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/ant-apache-log4j.jar:/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/ant-apache-bsf.jar:/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/ant-apache-bcel.jar:/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/ant-antlr.jar:/sol9/workspace/trunk/deployment/Sun_Java_System_Content_Delivery_Server_5.1_ga/dist/cds/localization:/sol9/workspace/trunk/deployment/Sun_Java_System_Content_Delivery_Server_5.1_ga/dist/cds/lib/cdslib/cdstools.jar:/sol9/workspace/trunk/deployment/Sun_Java_System_Content_Delivery_Server_5.1_ga/dist/cds/lib/cdslib/entity.jar:/sol9/workspace/trunk/deployment/Sun_Java_System_Content_Delivery_Server_5.1_ga/dist/cds/lib/cdslib/foundation.jar:/sol9/workspace/trunk/deployment/Sun_Java_System_Content_Delivery_Server_5.1_ga/dist/cds/lib/cdslib/cdsapi.jar:/sol9/workspace/trunk/deployment/Sun_Java_System_Content_Delivery_Server_5.1_ga/dist/cds/lib/external/jdom.jar:/sol9/workspace/trunk/deployment/Sun_Java_System_Content_Delivery_Server_5.1_ga/dist/cds/lib/ojdbc14.jar:/sol9/workspace/trunk/deployment/Sun_Java_System_Content_Delivery_Server_5.1_ga/dist/cds/lib/external/ojdbc14.jar:/sol9/workspace/trunk/deployment/Sun_Java_System_Content_Delivery_Server_5.1_ga/dist/cds/lib/external/jakarta-regexp-1.2.jar:/sol9/workspace/trunk/deployment/Sun_Java_System_Content_Delivery_Server_5.1_ga/dist/cds/lib/cdslib/dbmigration.jar -Ddefault-depl=cds -Ddefault-cfg=cds.cfg -Ddefault-dbconf=cdsDBConf.xml -Ddefault-dbuser=cdsDBSysUser.xml -Dcds.db.dir=/sol9/workspace/trunk/deployment/Sun_Java_System_Content_Delivery_Server_5.1_ga/cfg -Dcds.db.init.dir=/sol9/workspace/trunk/deployment/Sun_Java_System_Content_Delivery_Server_5.1_ga/dist/cds/database -Dcds.logging.config.file=/sol9/workspace/trunk/deployment/Sun_Java_System_Content_Delivery_Server_5.1_ga/cfg/logging.properties -Dfile.encoding=UTF-8 -Dant.home=/sol9/workspace/dependencies/tools/apache-ant-1.7.0 -Dcds.tools=/sol9/workspace/dependencies -Dcds.home=/sol9/workspace/trunk/deployment/Sun_Java_System_Content_Delivery_Server_5.1_ga com.sun.content.server.tools.deploy.InstallCommand import_handsets -deployment cds -dir /sol9/workspace/trunk/deployment/Sun_Java_System_Content_Delivery_Server_5.1_ga/dist/cds/perf_handset_definitions

/sol9/workspace/jdk1.5.0_11/bin/java
-classpath
/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/xml-apis.jar:
/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/xercesImpl.jar:
/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/ant.jar:
/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/ant-weblogic.jar:
/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/ant-trax.jar:
/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/ant-testutil.jar:
/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/ant-swing.jar:
/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/ant-stylebook.jar:
/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/ant-starteam.jar:
/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/ant-nodeps.jar:
/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/ant-netrexx.jar:
/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/ant-launcher.jar:
/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/ant-junit.jar:
/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/ant-jsch.jar:
/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/ant-jmf.jar:
/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/ant-jdepend.jar:
/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/ant-javamail.jar:
/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/ant-jai.jar:
/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/ant-commons-net.jar:
/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/ant-commons-logging.jar:
/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/ant-apache-resolver.jar:
/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/ant-apache-regexp.jar:
/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/ant-apache-oro.jar:
/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/ant-apache-log4j.jar:
/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/ant-apache-bsf.jar:
/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/ant-apache-bcel.jar:
/sol9/workspace/dependencies/tools/apache-ant-1.7.0/lib/ant-antlr.jar:
/sol9/workspace/trunk/deployment/Sun_Java_System_Content_Delivery_Server_5.1_ga/dist/cds/localization:
/sol9/workspace/trunk/deployment/Sun_Java_System_Content_Delivery_Server_5.1_ga/dist/cds/lib/cdslib/cdstools.jar:
/sol9/workspace/trunk/deployment/Sun_Java_System_Content_Delivery_Server_5.1_ga/dist/cds/lib/cdslib/entity.jar:
/sol9/workspace/trunk/deployment/Sun_Java_System_Content_Delivery_Server_5.1_ga/dist/cds/lib/cdslib/foundation.jar:
/sol9/workspace/trunk/deployment/Sun_Java_System_Content_Delivery_Server_5.1_ga/dist/cds/lib/cdslib/cdsapi.jar:
/sol9/workspace/trunk/deployment/Sun_Java_System_Content_Delivery_Server_5.1_ga/dist/cds/lib/external/jdom.jar:
/sol9/workspace/trunk/deployment/Sun_Java_System_Content_Delivery_Server_5.1_ga/dist/cds/lib/ojdbc14.jar:
/sol9/workspace/trunk/deployment/Sun_Java_System_Content_Delivery_Server_5.1_ga/dist/cds/lib/external/ojdbc14.jar:
/sol9/workspace/trunk/deployment/Sun_Java_System_Content_Delivery_Server_5.1_ga/dist/cds/lib/external/jakarta-regexp-1.2.jar:
/sol9/workspace/trunk/deployment/Sun_Java_System_Content_Delivery_Server_5.1_ga/dist/cds/lib/cdslib/dbmigration.jar
-Ddefault-depl=cds
-Ddefault-cfg=cds.cfg
-Ddefault-dbconf=cdsDBConf.xml
-Ddefault-dbuser=cdsDBSysUser.xml
-Dcds.db.dir=/sol9/workspace/trunk/deployment/Sun_Java_System_Content_Delivery_Server_5.1_ga/cfg
-Dcds.db.init.dir=/sol9/workspace/trunk/deployment/Sun_Java_System_Content_Delivery_Server_5.1_ga/dist/cds/database
-Dcds.logging.config.file=/sol9/workspace/trunk/deployment/Sun_Java_System_Content_Delivery_Server_5.1_ga/cfg/logging.properties
-Dfile.encoding=UTF-8 -Dant.home=/sol9/workspace/dependencies/tools/apache-ant-1.7.0 -Dcds.tools=/sol9/workspace/dependencies
-Dcds.home=/sol9/workspace/trunk/deployment/Sun_Java_System_Content_Delivery_Server_5.1_ga
com.sun.content.server.tools.deploy.InstallCommand import_handsets -deployment cds -dir /sol9/workspace/trunk/deployment/Sun_Java_System_Content_Delivery_Server_5.1_ga/dist/cds/perf_handset_definitions
